//
//  PlayDetailRecommendTopView.swift
//  TimMusic
//
//  Created by nkl on 2024/10/14.
//

import Foundation
import TSVideoKit

class PlayDetailRecommendTopView: UIView {
    lazy var titleLabel: UILabel = .simpleLabel(text: "Up Next", font: .systemFont18, color: .white)
    lazy var modelBtn : UIButton =  {
        let btn = UIButton()
        btn.setImage(UIImage.init(named: "ic_random"), for: .normal)
        return btn
    }()

    override init(frame: CGRect) {
        super.init(frame: frame)
        addChildren()
        makeConstraints()
        modelBtn.setImage(UIImage.init(named: TSVideoOperator.shared.playerViewModel.loopMode.icon), for: .normal)
    }

    func addChildren() {
        addSubview(titleLabel)
        addSubview(modelBtn)
    }

    func makeConstraints() {
        titleLabel.snp.makeConstraints { make in
            make.leading.top.equalToSuperview().offset(16)
        }
        
        modelBtn.snp.makeConstraints { make in
            make.trailing.equalToSuperview().offset(-16)
            make.width.height.equalTo(24)
            make.centerY.equalTo(titleLabel)
        }
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
